package cn.com.chengmandian.service.erp.constants;

public enum StockApplyStatusEnum {

    // 状态1-草稿 2-审核中 3-采购处理中 4-处理完成 5-已驳回 6-废弃 31-采购待确认 32-待发货 33-待签收
    DRAFT(1,"草稿"),
    AUDIT(2,"审核中"),
    START_HANDLE(3,"采购处理中"),
    FINISH_HANDLE(4,"处理完成"),
    REJECT(5,"已驳回"),
    DISCARD(6,"废弃"),
    PURCHASE_WAIT_SURE(31,"采购待确认"),
    WAIT_DELIVER(32,"待发货"),
    WAIT_SIGN(33,"待签收");


    private Integer code;
    public Integer getCode(){
        return this.code;
    }

    private String name;
    public String getName(){
        return this.name;
    }

    public static StockApplyStatusEnum getByCode(Integer code){
        if(code == null){
            return null;
        }else{
            StockApplyStatusEnum[] stockApplyStatusEnums = values();
            for(StockApplyStatusEnum stockApplyStatusEnum : stockApplyStatusEnums){
                if(stockApplyStatusEnum.getCode().equals(code)){
                    return stockApplyStatusEnum;
                }
            }
        }
        return null;
    }

    StockApplyStatusEnum(Integer code, String name){
        this.code = code;
        this.name = name;
    }
}
